package com.example.demo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication
public class SpringbootAutoConfigurationApplication implements CommandLineRunner {
	
	private static final Logger LOGGER = LoggerFactory.getLogger(SpringbootAutoConfigurationApplication.class);
	
	@Autowired
	private ApplicationContext context;
	
	public static void main(String[] args) {
		SpringApplication.run(SpringbootAutoConfigurationApplication.class, args);
	}
	
	@Override
	public void run(String... strings) throws Exception {
		for (String name : context.getBeanDefinitionNames()) {
			if("testAutoConfiguration".equals(name)){
				LOGGER.info(name);
			}
		}
	}
}
